#pragma once
#include "Poller.h"
namespace xncc {
namespace foundation {
    class Channel;
    class NoBlockPoller final : public Poller
    {
      public:
        NoBlockPoller();
        ~NoBlockPoller() override;
        NoBlockPoller(const NoBlockPoller&)             = delete;
        NoBlockPoller(const NoBlockPoller&&)            = delete;
        NoBlockPoller& operator=(const NoBlockPoller&)  = delete;
        NoBlockPoller& operator=(const NoBlockPoller&&) = delete;

        auto ioType() -> types::IO_MULTI_MODE::value override { return types::IO_MULTI_MODE::value::NO_IO_MULTI; }
        void addChannel(const std::shared_ptr<Channel>& chnl) override;
        void removeChannel(const std::shared_ptr<Channel>& chnl) override;
        void updateChannel(const std::shared_ptr<Channel>& chnl) override;
        void loopOnce(int waitUs) override;

      private:
        std::map<int, std::shared_ptr<Channel>> threadChannels_;
    };
}  // namespace foundation
}  // namespace xncc
